import request from "../../../utils/request";
enum API {
  GETMENU_URL = '/admin/acl/permission',
  ADDMENU_URL = '/admin/acl/permission/save',
  UPDATE_URL = '/admin/acl/permission/update',
  DELETE_URL = '/admin/acl/permission/remove/'
}

export const reqGetMenu = () => request.get(API.GETMENU_URL)
export const reqAddOrUpdate = (data: any) => {
  if (data.id) {
    request.put(API.UPDATE_URL, data)
  } else {
    request.post(API.ADDMENU_URL, data)
  }
}
export const reqDeleteMenu = (id: number) => request.delete(API.DELETE_URL + id)